import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import  ElementPlus from  'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/main.css'
import router from './router'

// 预览组件以及样式
// @ts-ignore
import VMdPreview from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
// VuePress主题以及样式（这里也可以选择github主题）
// @ts-ignore
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
//高亮代码行
// @ts-ignore
import createHighlightLinesPlugin from '@kangc/v-md-editor/lib/plugins/highlight-lines/index';
import '@kangc/v-md-editor/lib/plugins/highlight-lines/highlight-lines.css';




// Prism
// @ts-ignore
import  Prism from 'prismjs';
// 代码高亮
import 'prismjs/components/prism-json.js';
// 选择使用主题
VMdPreview.use(vuepressTheme, {
    Prism,
});
VMdPreview.use(createHighlightLinesPlugin());



Object.defineProperty(globalThis,'CESIUM_BASE_URL',{
    value:import.meta.env.VITE_CESIUM_BASE_URL
})

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(createPinia())
app.use(VMdPreview);
app.use(router).use(ElementPlus).mount('#app')
